function test() {
    var a = document.getElementById("banner");
    bannerHeight = null !== a ? a.scrollHeight : 0;
    var b = document.getElementById("info");
    if (b) {
        var c = b.scrollHeight
            , d = document.getElementById("bottom");
        if (d) {
            bottomHeight = d.scrollHeight;
            var e = document.documentElement.clientHeight
                , d = document.getElementById("bottom");
            bannerHeight + c + bottomHeight + 120 < e ? (d.style.position = "absolute",
                d.style.bottom = "0") : (d.style.position = "",
                    d.style.bottom = "")
        }
    }
}
function openWindow(a, b, c, d) {
    var e = (screen.width - b) / 2 - d
        , f = (screen.height - c) / 2 - d
        , g = window.open(a, "_blank", "width=" + b + ",height=" + c + ",toolbars=0,resizable=1,left=" + e + ",top=" + f);
    g.focus()
}
function std(obj) {
    var TimeFn = null
        , funs = $(obj).attr("onclick");
    $(obj).click(function () {
        clearTimeout(TimeFn),
            TimeFn = setTimeout(function () {
                eval(funs),
                    clearTimeout(TimeFn)
            }, 400)
    }),
        $(obj).dblclick(function () {
            clearTimeout(TimeFn)
        }),
        $(obj).removeAttr("onclick")
}
!function () {
    function a(a) {
        return a.replace(t, "").replace(u, ",").replace(v, "").replace(w, "").replace(x, "").split(y)
    }
    function b(a) {
        return "'" + a.replace(/('|\\)/g, "\\$1").replace(/\r/g, "\\r").replace(/\n/g, "\\n") + "'"
    }
    function c(c, d) {
        function e(a) {
            return m += a.split(/\n/).length - 1,
                k && (a = a.replace(/\s+/g, " ").replace(/<!--[\w\W]*?-->/g, "")),
                a && (a = s[1] + b(a) + s[2] + "\n"),
                a
        }
        function f(b) {
            var c = m;
            if (j ? b = j(b, d) : g && (b = b.replace(/\n/g, function () {
                return m++,
                    "$line=" + m + ";"
            })),
                0 === b.indexOf("=")) {
                var e = l && !/^=[=#]/.test(b);
                if (b = b.replace(/^=[=#]?|[\s;]*$/g, ""),
                    e) {
                    var f = b.replace(/\s*\([^\)]+\)/, "");
                    n[f] || /^(include|print)$/.test(f) || (b = "$escape(" + b + ")")
                } else
                    b = "$string(" + b + ")";
                b = s[1] + b + s[2]
            }
            return g && (b = "$line=" + c + ";" + b),
                r(a(b), function (a) {
                    if (a && !p[a]) {
                        var b;
                        b = "print" === a ? u : "include" === a ? v : n[a] ? "$utils." + a : o[a] ? "$helpers." + a : "$data." + a,
                            w += a + "=" + b + ",",
                            p[a] = !0
                    }
                }),
                b + "\n"
        }
        var g = d.debug
            , h = d.openTag
            , i = d.closeTag
            , j = d.parser
            , k = d.compress
            , l = d.escape
            , m = 1
            , p = {
                $data: 1,
                $filename: 1,
                $utils: 1,
                $helpers: 1,
                $out: 1,
                $line: 1
            }
            , q = "".trim
            , s = q ? ["$out='';", "$out+=", ";", "$out"] : ["$out=[];", "$out.push(", ");", "$out.join('')"]
            , t = q ? "$out+=text;return $out;" : "$out.push(text);"
            , u = "function(){var text=''.concat.apply('',arguments);" + t + "}"
            , v = "function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);" + t + "}"
            , w = "'use strict';var $utils=this,$helpers=$utils.$helpers," + (g ? "$line=0," : "")
            , x = s[0]
            , y = "return new String(" + s[3] + ");";
        r(c.split(h), function (a) {
            a = a.split(i);
            var b = a[0]
                , c = a[1];
            1 === a.length ? x += e(b) : (x += f(b),
                c && (x += e(c)))
        });
        var z = w + x + y;
        g && (z = "try{" + z + "}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:" + b(c) + ".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");
        try {
            var A = new Function("$data", "$filename", z);
            return A.prototype = n,
                A
        } catch (B) {
            throw B.temp = "function anonymous($data,$filename) {" + z + "}",
            B
        }
    }
    var d = function (a, b) {
        return "string" == typeof b ? q(b, {
            filename: a
        }) : g(a, b)
    };
    d.version = "3.0.0",
        d.config = function (a, b) {
            e[a] = b
        }
        ;
    var e = d.defaults = {
        openTag: "<%",
        closeTag: "%>",
        escape: !0,
        cache: !0,
        compress: !1,
        parser: null
    }
        , f = d.cache = {};
    d.render = function (a, b) {
        return q(a, b)
    }
        ;
    var g = d.renderFile = function (a, b) {
        var c = d.get(a) || p({
            filename: a,
            name: "Render Error",
            message: "Template not found"
        });
        return b ? c(b) : c
    }
        ;
    d.get = function (a) {
        var b;
        if (f[a])
            b = f[a];
        else if ("object" == typeof document) {
            var c = document.getElementById(a);
            if (c) {
                var d = (c.value || c.innerHTML).replace(/^\s*|\s*$/g, "");
                b = q(d, {
                    filename: a
                })
            }
        }
        return b
    }
        ;
    var h = function (a, b) {
        return "string" != typeof a && (b = typeof a,
            "number" === b ? a += "" : a = "function" === b ? h(a.call(a)) : ""),
            a
    }
        , i = {
            "<": "&#60;",
            ">": "&#62;",
            '"': "&#34;",
            "'": "&#39;",
            "&": "&#38;"
        }
        , j = function (a) {
            return i[a]
        }
        , k = function (a) {
            return h(a).replace(/&(?![\w#]+;)|[<>"']/g, j)
        }
        , l = Array.isArray || function (a) {
            return "[object Array]" === {}.toString.call(a)
        }
        , m = function (a, b) {
            var c, d;
            if (l(a))
                for (c = 0,
                    d = a.length; d > c; c++)
                    b.call(a, a[c], c, a);
            else
                for (c in a)
                    b.call(a, a[c], c)
        }
        , n = d.utils = {
            $helpers: {},
            $include: g,
            $string: h,
            $escape: k,
            $each: m
        };
    d.helper = function (a, b) {
        o[a] = b
    }
        ;
    var o = d.helpers = n.$helpers;
    d.onerror = function (a) {
        var b = "Template Error\n\n";
        for (var c in a)
            b += "<" + c + ">\n" + a[c] + "\n\n";
        "object" == typeof console && console.error(b)
    }
        ;
    var p = function (a) {
        return d.onerror(a),
            function () {
                return "{Template Error}"
            }
    }
        , q = d.compile = function (a, b) {
            function d(c) {
                try {
                    return new i(c, h) + ""
                } catch (d) {
                    return b.debug ? p(d)() : (b.debug = !0,
                        q(a, b)(c))
                }
            }
            b = b || {};
            for (var g in e)
                void 0 === b[g] && (b[g] = e[g]);
            var h = b.filename;
            try {
                var i = c(a, b)
            } catch (j) {
                return j.filename = h || "anonymous",
                    j.name = "Syntax Error",
                    p(j)
            }
            return d.prototype = i.prototype,
                d.toString = function () {
                    return i.toString()
                }
                ,
                h && b.cache && (f[h] = d),
                d
        }
        , r = n.$each
        , s = "break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined"
        , t = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g
        , u = /[^\w$]+/g
        , v = new RegExp(["\\b" + s.replace(/,/g, "\\b|\\b") + "\\b"].join("|"), "g")
        , w = /^\d[^,]*|,\d[^,]*/g
        , x = /^,+|,+$/g
        , y = /^$|,+/;
    e.openTag = "{{",
        e.closeTag = "}}";
    var z = function (a, b) {
        var c = b.split(":")
            , d = c.shift()
            , e = c.join(":") || "";
        return e && (e = ", " + e),
            "$helpers." + d + "(" + a + e + ")"
    };
    e.parser = function (a) {
        a = a.replace(/^\s/, "");
        var b = a.split(" ")
            , c = b.shift()
            , e = b.join(" ");
        switch (c) {
            case "if":
                a = "if(" + e + "){";
                break;
            case "else":
                b = "if" === b.shift() ? " if(" + b.join(" ") + ")" : "",
                    a = "}else" + b + "{";
                break;
            case "/if":
                a = "}";
                break;
            case "each":
                var f = b[0] || "$data"
                    , g = b[1] || "as"
                    , h = b[2] || "$value"
                    , i = b[3] || "$index"
                    , j = h + "," + i;
                "as" !== g && (f = "[]"),
                    a = "$each(" + f + ",function(" + j + "){";
                break;
            case "/each":
                a = "});";
                break;
            case "echo":
                a = "print(" + e + ");";
                break;
            case "print":
            case "include":
                a = c + "(" + b.join(",") + ");";
                break;
            default:
                if (/^\s*\|\s*[\w\$]/.test(e)) {
                    var k = !0;
                    0 === a.indexOf("#") && (a = a.substr(1),
                        k = !1);
                    for (var l = 0, m = a.split("|"), n = m.length, o = m[l++]; n > l; l++)
                        o = z(o, m[l]);
                    a = (k ? "=" : "=#") + o
                } else
                    a = d.helpers[c] ? "=#" + c + "(" + b.join(",") + ");" : "=" + a
        }
        return a
    }
        ,
        "function" == typeof define ? define(function () {
            return d
        }) : "undefined" != typeof exports ? module.exports = d : this.template = d
}(),
    function (a) {
        function b(b, c) {
            var d = a(this).data("opts");
            if ("x" == d.dir) {
                var e = b * d.width;
                a(this).find(".ck-slide-wrapper").stop().animate({
                    "margin-left": -e
                }, function () {
                    d.isAnimate = !1
                }),
                    d.isAnimate = !0
            } else
                a(this).find(".ck-slide-wrapper li").eq(c).stop().animate({
                    opacity: 0
                }).css("z-index", 2),
                    a(this).find(".ck-slide-wrapper li").eq(b).show().css({
                        opacity: 0
                    }).stop().animate({
                        opacity: 1
                    }).css("z-index", 3);
            a(this).find(".ck-slidebox li").removeClass("current"),
                a(this).find(".ck-slidebox li").eq(b).addClass("current")
        }
        a.fn.ckSlide = function (c) {
            c = a.extend({}, a.fn.ckSlide.opts, c),
                this.each(function () {
                    function d() {
                        c.autoPlay && (j = setInterval(function () {
                            var a = i;
                            i >= g - 1 ? i = 0 : i++,
                                b.call(h, i, a)
                        }, 4e3))
                    }
                    var e = a(this).find(".ck-slide-wrapper")
                        , f = e.find("li")
                        , g = f.length
                        , h = this
                        , i = 0
                        , j = null;
                    a(this).data("opts", c),
                        a(this).find(".ck-next").on("click", function () {
                            if (1 != c.isAnimate) {
                                var a = i;
                                i >= g - 1 ? i = 0 : i++,
                                    b.call(h, i, a)
                            }
                        }),
                        a(this).find(".ck-prev").on("click", function () {
                            if (1 != c.isAnimate) {
                                var a = i;
                                0 >= i ? i = g - 1 : i--,
                                    b.call(h, i, a)
                            }
                        }),
                        a(this).find(".ck-slidebox li").each(function (c) {
                            a(this).on("click.slidebox", function () {
                                b.call(h, c, i),
                                    i = c
                            })
                        }),
                        a(this).on("mouseover", function () {
                            c.autoPlay && clearInterval(j),
                                a(this).find(".ctrl-slide").css({
                                    opacity: .6
                                })
                        }),
                        a(this).on("mouseleave", function () {
                            c.autoPlay && d(),
                                a(this).find(".ctrl-slide").css({
                                    opacity: .15
                                })
                        }),
                        d();
                    var k = a(this).find(".ck-slidebox");
                    switch (k.css({
                        "margin-left": -(k.width() / 2)
                    }),
                    c.dir) {
                        case "x":
                            c.width = a(this).width(),
                                e.css({
                                    width: g * c.width
                                }),
                                f.css({
                                    "float": "left",
                                    position: "relative"
                                }),
                                e.wrap('<div class="ck-slide-dir"></div>'),
                                f.show()
                    }
                })
        }
            ,
            a.fn.ckSlide.opts = {
                autoPlay: !1,
                dir: null,
                isAnimate: !1
            }
    }(jQuery),
    $(function () {
        function a() {
            $(".container").css({
                height: "84px"
            }, 300),
                $(".big").slideUp(300),
                $(".small").slideDown(400),
                $(".nav-bg").css({
                    top: "84px"
                }),
                $(".slider").css({
                    marginTop: "84px"
                }),
                setTimeout(function () {
                    d()
                }, 3e3)
        }
        function b() {
            $(".pcdown").css({
                display: "block"
            }),
                $(".container").css({
                    height: "84px"
                }),
                $(".small").slideDown(400),
                $(".big").hide(),
                $(".nav-bg").css({
                    position: "fixed",
                    top: "84px"
                }),
                $(".wraper-bg").css({
                    position: "static"
                }),
                $(".slider").css({
                    marginTop: "84px"
                }),
                setTimeout(function () {
                    d()
                }, 3e3)
        }
        function c() {
            $(".pcdown").slideDown(),
                $(".nav-bg").css({
                    top: "400px",
                    position: "fixed"
                }),
                $(".wraper-bg").css({
                    position: "static"
                }),
                $(".slider").css({
                    marginTop: "477px"
                }),
                g = setTimeout(function () {
                    a()
                }, 8e3);
            var b = new Date;
            b.setTime(b.getTime() + 2592e6),
                document.cookie = "isShown=1;expires=" + b.toGMTString()
        }
        function d() {
            $(".pcdown").slideUp(),
                $(".nav-bg").css({
                    position: "static",
                    top: "0px"
                }),
                $(".wraper-bg").css({
                    position: "fixed",
                    zIndex: "9999",
                    top: "32px"
                }),
                $(".slider").css({
                    marginTop: "0px"
                }),
                f(),
                $(window).scroll(f)
        }
        var e = "undefined" != typeof pushend && 1 == pushend ? 106 : 32
            , f = function () {
                $(document).scrollTop() > e ? $(".wraper-bg").css({
                    top: "0px",
                    position: "fixed"
                }) : $(".wraper-bg").css({
                    top: "32px",
                    position: "absolute"
                })
            }
            , g = null;
        $(".pc-close").click(function () {
            var a = new Date;
            a.setTime(a.getTime() + 2592e6),
                document.cookie = "downTip=1;expires=" + a.toGMTString(),
                d()
        }),
            $(".pcdown").length > 0 && !isMobile && 1 != getCookie("downTip") ? 1 == getCookie("isShown") ? b() : c() : (f(),
                $(window).scroll(f)),
            $(".nav_down").hide(),
            $(".nav-collapse li").hover(function () {
                $(".nav-collapse li .nav_down").is(":visible") ? $(this).find(".nav_down").hide() : $(this).find(".nav_down").show()
            }),
            $(".mymesg").hide(),
            $(".mod_log").hover(function () {
                $(".mymesg").is(":visible") ? ($(this).find(".nav_lio").removeClass("on"),
                    $(this).find(".mymesg").hide()) : ($(this).find(".nav_lio").addClass("on"),
                        $(this).find(".mymesg").show())
            });
        var h = $(".m-nav ul li").length;
        $(".m-nav ul li").css({
            width: 100 / h + "%"
        }),
            $(".nav-down").hover(function () {
                $(this).children(".nav-down-menu").show()
            }, function () {
                $(this).children(".nav-down-menu").hide()
            }),
            $(".m-nav-down").hover(function () {
                $(this).children(".m-nav-down-menu").show()
            }, function () {
                $(this).children(".m-nav-down-menu").hide()
            }),
            $(".m-all").hover(function () {
                $(".m-all .m-all-down").is(":visible") ? $(this).find(".m-all-down").hide() : $(this).find(".m-all-down").show()
            }),
            $(".m-down").click(function () {
                return $(".body-inner").addClass("slide-left").removeClass("slide-right"),
                    !1
            }),
            $(".bg").click(function () {
                return $(".body-inner").addClass("slide-right").removeClass("slide-left"),
                    !1
            }),
            $(".zuijin_list li").hover(function () {
                ("undefined" == typeof $(this).attr("done") || $(this).find(".detail_tip").text().length < 20) && (objli = $(this),
                    eventId = $(this).attr("eventId"),
                    eventId || (eventId = 0),
                    stageId = $(this).attr("stageId"),
                    stageId || (stageId = 0),
                    scheduleId = $(this).attr("scheduleId"),
                    scheduleId || (scheduleId = 0),
                    $.ajax({
                        type: "GET",
                        url: "/ajax/event/block?eventId=" + eventId + "&stageId=" + stageId + "&sheduleId=" + scheduleId,
                        dataType: "html",
                        success: function (a) {
                            0 != a.length ? objli.find(".detail_tip").html(a) : objli.find(".detail_tip").hide()
                        }
                    })),
                    $(this).find(".detail_tip").show(),
                    $(this).attr("done", 1)
            }, function () {
                $(this).find(".detail_tip").hide()
            }),
            $(".searchbox input.seach_text,.searchbox input:text,.nav-search-input input.search_text").focus(function () {
                var a = $(this)
                    , b = a.val()
                    , c = a.data("placeholder");
                "undefined" == typeof c && (a.data("placeholder", b),
                    c = b,
                    a.hasClass("seach_text") && $(".seach_text").css({
                        color: "#aaa"
                    })),
                    c == b && (a.val(""),
                        a.hasClass("seach_text") && $(".seach_text").css({
                            color: "#aaa"
                        }))
            }).blur(function () {
                var a = $(this);
                "" == a.val() && (a.val(a.data("placeholder")),
                    a.hasClass("seach_text") && $(".seach_text").css({
                        color: "#525051"
                    }))
            }),
            $(".hover_img").hover(function () {
                $(this).find(".match_tip").show()
            }, function () {
                $(this).find(".match_tip").hide()
            }),
            $(".mod_tba tr").hover(function () {
                $(this).css({
                    background: "#fafafa"
                }),
                    $(this).find(".match span").css({
                        color: "#bd2429"
                    })
            }, function () {
                $(this).css({
                    background: "none"
                }),
                    $(this).find(".match span").css({
                        color: "#000000"
                    })
            }),
            $(".hero_tbb li,.mod_tba li").hover(function () {
                $(this).find(".match_tip").show(),
                    $(this).css({
                        background: "#fafafa"
                    }),
                    $(this).find(".match span").css({
                        color: "#bd2429"
                    })
            }, function () {
                $(this).find(".match_tip").hide(),
                    $(this).css({
                        background: "none"
                    }),
                    $(this).find(".match span").css({
                        color: "#000000"
                    })
            })
    }),
    $(".select-wrap").click(function () {
        $(this).find("ul").length && $(this).find("ul").show(),
            $(this).siblings(".select-wrap ul").hide()
    }),
    $(".select-wrap").delegate("li", "click", function (a) {
        a.stopPropagation();
        var b, c = $(this).parents("ul");
        if (c.siblings("input").val(g),
            "player" == pageName) {
            var d = $(this).data("val");
            b = 0 != d ? "/" + game + "/player/" + playerId + "?heroId=" + d + "#recent" : "/" + game + "/player/" + playerId + "#recent"
        } else if ("team" == pageName) {
            var e = $(this).data("val");
            b = 0 != e ? "/" + game + "/team/" + teamId + "?objTeamId=" + e + "#recent" : "/" + game + "/team/" + teamId + "#recent"
        } else if ("search" == pageName) {
            var f, g = $(this).attr("itemId"), h = $(this).attr("type"), f = $(this).attr("gameName");
            b = "/" + f + "/" + h + "/" + g
        }
        window.location.href = b
    }),
    $(".select-wrap").mouseleave(function (a) {
        a.stopPropagation(),
            $(this).find("ul").hide()
    }),
    $(function () {
        $(".searchbar-wrap li").hover(function () {
            $(this).addClass("hover")
        }, function () {
            $(this).removeClass("hover")
        })
    }),
    $(function () {
        var a = $(".hero_nav li");
        a.click(function () {
            $(this).addClass("on").siblings().removeClass("on");
            var b = a.index(this);
            $(".hero_con .hero_tabbox").eq(b).show().siblings().hide()
        })
    }),
    $(function () {
        $(".joincp_list li a").click(function () {
            $(this).addClass("chose").parent().siblings().find("a").removeClass("chose")
        })
    }),
    $("a").bind("focus", function () {
        this.blur && this.blur()
    }),
    $(function () {
        $(".hero_list li:gt(2):not(:last)").hide(),
            $(".hero_list_box .pages").hide(),
            $(".hero_btns a.mr3").click(function () {
                "查看全部" == $(".hero_btns a.mr3").text() ? ($(".hero_list li:gt(2):not(:last)").show(),
                    $(".hero_list_box .pages").show(),
                    $(".hero_btns a.mr3").text("收起短评").addClass("hero_btnon")) : ($(".hero_list li:gt(2):not(:last)").hide(),
                        $(".hero_list_box .pages").hide(),
                        $(".hero_btns a.mr3").text("查看全部").removeClass("hero_btnon"))
            }),
            $(".fabu_box").hide(),
            $(".hero_btns a.fabu_btn").click(function () {
                "发布短评" == $(".hero_btns a.fabu_btn").text() ? ($(".fabu_box").show(),
                    $(".hero_btns a.fabu_btn").text("取消发布").addClass("hero_btnon")) : ($(".fabu_box").hide(),
                        $(".hero_btns a.fabu_btn").text("发布短评").removeClass("hero_btnon"))
            })
    }),
    $(".search_btn").click(function () {
        var a = $(this).siblings("input").val()
            , b = gameName ? "/" + gameName + "/" : "/";
        b += a && "赛事、战队、选手、英雄、文章" != a && "输入英雄、装备全称或简称" != a ? "search?k=" + a : "search",
            location.href = b
    }),
    $(function () {
        $(".seach_text,.search_text").bind("keydown", function (a) {
            var b = document.all ? window.event : a;
            13 == b.keyCode && $(this).siblings(".search_btn").click()
        })
    });
var getToken = function () {
    var a = getCookie("wanplus_token");
    return token = a ? time33(a) : "",
        token
}
    , getCookie = function (a) {
        var b = new RegExp("(^| )" + a + "=([^;]*)(;|$)");
        return val = document.cookie.match(b),
            val ? unescape(val[2]) : null
    }
    , time33 = function (a) {
        a = a.slice(0, 7);
        for (var b = 0, c = a.length, d = 5381; c > b; ++b)
            d += (d << 5) + a.charAt(b).charCodeAt();
        return 2147483647 & d
    };
$.ajaxSetup({
    data: {
        _gtk: getToken()
    }
}),
    $(document).ajaxSend(function (a, b, c) {
        b.setRequestHeader("X-CSRF-Token", getToken())
    });
var fixSideBar = function (a) {
    function b() {
        var a = document.body.scrollTop || document.documentElement.scrollTop
            , b = $(document).height()
            , g = $(window).height()
            , i = c.height()
            , j = d.height()
            , k = g - i
            , l = b - a - g;
        if (i >= j)
            return c.css({
                position: "static"
            }),
                !1;
        var m = i > g
            , n = a + g > b - h;
        return e + i > a + g ? (c.css({
            position: "static"
        }),
            !1) : m ? (c.css({
                position: "fixed",
                top: n ? k - (h - l) : k
            }),
                !1) : void c.css({
                    position: "fixed",
                    top: Math.max(e - a, f + 15)
                })
    }
    a = a || {};
    var c = a.right || $(".right-fixed")
        , d = a.left || $(".left");
    if (c.length <= 0)
        return !1;
    var e = c.offset().top
        , f = 45
        , g = $(".bottom-adv").length > 0 ? $(".bottom-adv").height() + 20 : 0
        , h = ($(".foot_wrap").length > 0 ? $(".foot_wrap").height() : 0) + g;
    if ($(".content").length > 0) {
        var i = $(".content").css("margin-bottom")
            , j = $(".content").css("padding-bottom");
        h += parseFloat(i) + parseFloat(j) - 10
    }
    window.onscroll = b
}
    , fixedBar = function () {
        function a(a) {
            for (var b = a, c = b.offsetTop, d = b.offsetLeft; b = b.offsetParent;)
                c += b.offsetTop,
                    d += b.offsetLeft;
            a.data_top = c,
                a.data_left = d
        }
        function b() {
            var a = document.body.scrollTop || document.documentElement.scrollTop;
            c.data_top < a ? (c.style.position = "fixed",
                c.style.top = "0px") : c.style.position = "static"
        }
        var c = document.getElementById("fixedBar");
        if (c) {
            var d = document.documentElement.offsetWidth;
            window.onresize = function () {
                var e = document.documentElement.offsetWidth;
                d != e && (d = e,
                    c.style.position = "static",
                    a(c),
                    b())
            }
                ,
                a(c),
                window.onscroll = b
        }
    }
    , setMsgRedPoint = function (a, b) {
        $(".nav-list-detail li").hide(),
            $(".nav-list-detail ." + a).show(),
            $("#notice-up").removeClass(),
            $("#notice-reply").removeClass(),
            "notice-up" == a ? ("1" == b ? $("#" + a).addClass("nav-hand-click") : $("#" + a).addClass("nav-hand"),
                "1" == $("#notice-reply").attr("unread") ? $("#notice-reply").addClass("nav-talk-had") : $("#notice-reply").addClass("nav-talk-no")) : "notice-reply" == a && ("1" == b ? $("#" + a).addClass("nav-talk-click") : $("#" + a).addClass("nav-talk"),
                    "1" == $("#notice-up").attr("unread") ? $("#notice-up").addClass("nav-hand-had") : $("#notice-up").addClass("nav-hand-no"))
    }
    , setMsgReaded = function (a) {
        $(a).click(function () {
            var a = $(this).attr("isread")
                , b = $(this).attr("msgid");
            if ("0" == a && "0" != b) {
                var c = this;
                $.ajax({
                    type: "POST",
                    url: "/prompt/do",
                    data: {
                        action: "setread",
                        msgid: b
                    },
                    dataType: "json",
                    success: function (a) {
                        if (0 == a.ret) {
                            $(c).removeClass("new-notice"),
                                $(c).attr("isread", 1),
                                0 == a.data.newprompt ? $(".nav-notice-mail").html("") : a.data.newprompt < 99 ? $(".nav-notice-mail .two-num").text(a.data.newprompt) : $(".nav-notice-mail .two-num").text("99+");
                            var b = $(c).attr("class")
                                , d = /notice-up/
                                , e = ""
                                , f = 0;
                            e = d.test(b) ? "notice-up" : "notice-reply",
                                $(".nav-list-detail ." + e).each(function (a) {
                                    "0" == $(this).attr("isread") && (f = 1)
                                }),
                                setMsgRedPoint(e, f),
                                $("#" + e).attr("unread", f)
                        }
                    }
                })
            }
        })
    };
$(document).ready(function () {
    $(".xx_top ").click(function () {
        $("html,body").animate({
            scrollTop: 0
        }, 1e3)
    }),
        $(window).scroll(function () {
            $(document).scrollTop() >= $(window).height() ? $(".xx_top").show() : $(".xx_top").hide()
        }),
        fixedBar(),
        $(".nav-notice-top span").click(function () {
            var a = $(this).attr("id")
                , b = $(this).attr("unread");
            setMsgRedPoint(a, b)
        }),
        $(".nav-notice-bottom .set-all-notice").click(function () {
            var a = parseInt($(".nav-notice-mail .two-num").text());
            return 0 != a && a ? void $.ajax({
                type: "POST",
                url: "/prompt/do",
                data: {
                    action: "setall"
                },
                dataType: "json",
                success: function (a) {
                    0 == a.ret && $(".nav-notice-mail").html("")
                }
            }) : !1
        }),
        $(".nav-notice").unbind("onclick").click(function () {
            $(".nav-notice-list").show(),
                "1" != $(".nav-notice-mail").attr("done") && ($(".nav-list-detail").hide(),
                    $(".notice-loading").show(),
                    $.ajax({
                        type: "POST",
                        url: "/prompt/do",
                        data: {
                            action: "get"
                        },
                        dataType: "json",
                        success: function (a) {
                            if (0 == a.ret) {
                                $(".notice-loading").hide();
                                var b = a.data;
                                $(".nav-list-detail").html(b.html).show(),
                                    b.newup && ($("#notice-up").removeClass(),
                                        $("#notice-up").addClass("nav-hand-had"),
                                        $("#notice-up").attr("unread", 1)),
                                    b.newreply && ($("#notice-reply").removeClass(),
                                        $("#notice-reply").addClass("nav-talk-click"),
                                        $("#notice-reply").attr("unread", 1)),
                                    setMsgReaded(".nav-list-detail li"),
                                    $(".nav-notice-mail").attr("done", 1)
                            }
                        }
                    })),
                $(document).bind("click", function (a) {
                    for (var a = a || window.event, b = a.target || a.srcElement; b;) {
                        if (b.id && "nav-notice" == b.id)
                            return;
                        b = b.parentNode
                    }
                    $("#nav-notice .nav-notice-list").hide(500)
                })
        })
}),
    $(".reg").click(function () {
        $(".index-login-bg").hide(),
            $(".fullscreen-bg-oc").show(),
            $(".index-regist-bg").show(),
            Login.register()
    }),
    $(".login").click(function () {
        $(".index-login-bg").show(),
            $(".fullscreen-bg-oc").show(),
            $(".index-regist-bg").hide(),
            Login.login()
    });
var showLogin = function () {
    $(".fullscreen-bg-oc").show(),
        $(".index-login-bg").show(),
        Login.login()
}
    , showDetailTips = function (a, b, c, d) {
        var e;
        $(a).each(function () {
            $(this).hover(function () {
                e && window.clearTimeout(e);
                var a = this;
                e = window.setTimeout(function () {
                    var e = $(a).data("itemid");
                    return b && e && c ? void $.ajax({
                        type: "POST",
                        url: "/ajax/common/block",
                        dataType: "html",
                        data: {
                            id: e,
                            t: c,
                            gt: b,
                            f: d
                        },
                        success: function (b) {
                            if (0 != b.length) {
                                var c = $(a).offset().left
                                    , d = $(a).offset().top
                                    , e = $(a).width() + 10;
                                $("body").append('<div class="detail-tips"></div>'),
                                    $(".detail-tips").html(b).append('<span class="arrow-left"></span>').css("left", c + e).css("top", d)
                            }
                        }
                    }) : ""
                }, 500)
            }, function () {
                e && window.clearTimeout(e),
                    $(".detail-tips").remove()
            })
        })
    }
    , fnTimeDown = function (a, b) {
        var c = {
            zero: function (a) {
                var a = parseInt(a, 10);
                return a > 0 ? (9 >= a && (a = "0" + a),
                    String(a)) : "00"
            },
            dv: function () {
                var b = new Date
                    , d = Math.round((a - b.getTime()) / 1e3)
                    , e = {
                        sec: "0",
                        mini: "0",
                        hour: "0",
                        day: "0"
                    };
                return d > 0 && (e.sec = c.zero(d % 60),
                    e.mini = Math.floor(d / 60) > 0 ? c.zero(Math.floor(d / 60) % 60) : "0",
                    e.hour = Math.floor(d / 3600) > 0 ? c.zero(Math.floor(d / 3600) % 24) : "0",
                    e.day = Math.floor(d / 86400) > 0 ? c.zero(Math.floor(d / 86400)) : "0"),
                    e
            },
            init: function () {
                b || (b = {
                    sec: $("#sec"),
                    mini: $("#mini"),
                    hour: $("#hour"),
                    day: $("#day")
                }),
                    b.sec && b.sec.html(c.dv().sec),
                    b.mini && b.mini.html(c.dv().mini),
                    b.hour && b.hour.html(c.dv().hour),
                    b.day && b.day.html(c.dv().day),
                    setTimeout(c.init, 1e3)
            }
        };
        c.init()
    }
    , initSortIcon = function (a) {
        $(".sortable th").click(function () {
            if (0 == $(this).index())
                return !1;
            var b, c = $(this).children("i").attr("class");
            if ("down" == c)
                b = "up";
            else {
                if ("up" != c && "gray" != c)
                    return !1;
                b = "down"
            }
            $(this).parent().children().find("i").attr("class", "gray"),
                $(this).children("i").attr("class", b),
                a && setTimeout(function () {
                    $(".list-table img").lazyload({
                        placeholder: dfImg
                    })
                }, 50)
        })
    }
    , initDataTable = function (a, b, c) {
        c.DataTable({
            iDisplayLength: 500,
            bLengthChange: !1,
            bPaginate: !1,
            sSearch: !1,
            bFilter: !1,
            bInfo: !1,
            aoColumns: b,
            aaSorting: a,
            oLanguage: {
                sEmptyTable: '<span class="c_red">没有比赛记录。</span>',
                oPaginate: {
                    sNext: "",
                    sPrevious: ""
                }
            }
        })
    }
    , buildPlayer = function (a, b, c) {
        var d = "";
        if ("iframe" == a)
            d += '<iframe width="100%" height="100%" src="' + b + '" frameborder="0"></iframe>';
        else if ("video" == a)
            d += '<video width="100%" height="100%" src="' + b + '" controls="true">';
        else if ("script" == a)
            0 == $("#youkuapi").length && (d += '<script src="http://player.youku.com/jsapi"></script>'),
                0 == $("#youkuplayer").length && (d += '<div id="youkuplayer" style="width:100%;height:100%"></div>'),
                0 == $("#youkuinit").length && (d += '<script id="youkuinit">initVideoPlayer = function (vid) {new YKU.Player("youkuplayer",{styleid: "0",client_id: "e10c03708b12ecf3",vid: vid,autoplay: true,wmode: "transparent"});};</script>');
        else {
            if ("embed" != a)
                return "";
            d += '<embed width="100%" height="100%" src="' + b + '" allowfullscreen="true" wmode="opaque" allowscriptaccess="always">'
        }
        return d
    }
    , LOGIN = function () {
        return this.temporaryId = "",
            this.wxQrCodeExpiredTime = 0,
            this.wxQrCodeTimer = 0,
            this
    };
LOGIN.prototype = {
    init: function () {
        this.bindEvent()
    },
    bindEvent: function () {
        var a = this;
        $("#wx-login-btn, .wx-login-btn").unbind("click").click(function (b) {
            b.preventDefault(),
                a.getWxQrCode(),
                $("#wx-login-modal").fadeIn(500).find(".wx-login-wrapper").slideDown(500)
        }),
            $("#wx-modal-close-btn").unbind("click").click(function () {
                clearTimeout(a.wxQrCodeTimer),
                    $("#wx-login-modal").fadeOut(500).find(".wx-login-wrapper").slideUp(500)
            }),
            $("#refresh-wx-qr-code").unbind("click").click(function () {
                a.getWxQrCode()
            })
    },
    getWxQrCode: function () {
        var a = this
            , b = (new Date).getTime().toString();
        this.temporaryId = b.substr(b.length - 4, 4) + Math.random().toString().substr(2, 6),
            $.ajax({
                url: "/login/getWechatQrCode?temporary_id=" + this.temporaryId,
                type: "GET",
                dataType: "json",
                success: function (b) {
                    try {
                        $("#wx-qr-code-img").attr("src", b.data.qrcode_url).show(),
                            a.wxQrCodeExpiredTime = b.data.expiration_time,
                            $(".wx-qr-code-wrapper").find(".refresh-qr-code").css("display", "none"),
                            setTimeout(function () {
                                a.getWxQrCodeScanStatus()
                            }, 3e3)
                    } catch (c) {
                        $(".wx-qr-code-wrapper").find(".refresh-qr-code").css("display", "flex")
                    }
                }
            })
    },
    getWxQrCodeScanStatus: function () {
        var a = this;
        this.wxQrCodeExpiredTime > Number((new Date).getTime().toString().substr(0, 10)) ? this.wxQrCodeTimer = setTimeout(function () {
            a.getWxQrCodeScanStatus()
        }, 3e3) : $(".wx-qr-code-wrapper").find(".refresh-qr-code").css("display", "flex"),
            $.ajax({
                url: "/login/getWechatQrCodeFollowStatus?temporary_id=" + this.temporaryId,
                type: "GET",
                dataType: "json",
                success: function (a) {
                    try {
                        if (a.data.url) {
                            var b = window.location.href;
                            -1 !== b.indexOf("/login") ? window.location.href = document.referrer : location.reload()
                        }
                    } catch (c) { }
                }
            })
    }
};
var Login = function () {
    var a = function (a, b) {
        var c = b.transit.width
            , d = b.transit.height
            , e = (window.screen.availHeight - d) / 2
            , f = (window.screen.availWidth - 10 - c) / 2
            , g = window.open(a, "_blank", "location=no,top=" + e + ",left=" + f + ",toolbar=no,titlebar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + c + ", height=" + d);
        g.focus()
    }
        , b = function (a, b) {
            var c = {
                openid: "",
                thirdnickname: "",
                isregister: "",
                thirdtype: ""
            };
            if (c = $.extend(c, a),
                !c.thirdtype)
                return !1;
            for (var d = {
                nickname: '<div class="control-group"><label class="control-label">昵称:</label><input type="text" autocomplete="off" id="third-reg-nickname" name="nickname" class="control-input input-bold" value="' + c.thirdnickname + '"><span class="nickname-third-hid" style="display:none"></span><span id="msg-third-nickname" class="input-msg-tips" style="display:none"></span></div>',
                mobile: '<div class="control-group"><label class="control-label">手机:</label><input type="text" autocomplete="off" id="third-reg-mobile" name="mobile" class="control-input" value=""><span class="mobile-third-hid" style="display:none"></span><span id="msg-third-mobile" class="input-msg-tips" style="display:none"></span></div><div class="control-group"><input id="third-reg-vcode" type="text" autocomplete="off" class="control-input message" value=""><button class="send sms-send">发送验证码</button><span class="vcode-third-hid" style="display:none"></span><span id="msg-third-vcode" class="input-msg-tips" style="display:none"></span></div>',
                email: '<div class="control-group"><label class="control-label">邮箱:</label><input type="text" autocomplete="off" id="third-reg-email" name="email" class="control-input" value=""><span class="email-third-hid" style="display:none"></span><span id="msg-third-email" class="input-msg-tips" style="display:none"></span></div>',
                password: '<div class="key-reg"><input class="key-reg-txt" type="password" autocomplete="off" onfocus="if(this.value == \'请输入密码\') this.value = \'\'" onblur="if(this.value == \'\') this.value = \'请输入密码\'" value="请输入密码" name="password"><span class="password-third-hid"></span><span class="key-reg-error" id="msg-third-password"></span></div>'
            }, e = "<div class='bind-backdrop' id='bindbackground'></div><div id='signin' class='rl-bind'><div class='rl-bind-header'><p class='bind-header-logo'><img width='87px' height='87px' src='/images/login/logo_yuan.png' /></p><p class='bind-header-tips'><span>为了保障您的账号安全</span><span>请确定昵称并绑定联系方式</span></p></div><div class='rl-bind-body'><div class='clearfix'>", g = 0; g < b.length; ++g)
                e += d[b[g]];
            e += "<div class='control-group' id ='seml' style='display:none'><span class='c1_red' >修改密码邮件已发送至邮箱注意查收</span></div></div><div class='control-group'><input type='checkbox' class='' name='bindArgeen' value='1' id='third-reg-agree'><label for=''>我已阅读并同意<a href='http://mp.weixin.qq.com/s?__biz=MzA5ODc3Mjg5Ng==&amp;mid=209961836&amp;idx=1&amp;sn=89e429e72b52505763807ccb94335d30#rd' target='_blank'>《玩加使用协议》</a></label></div><input type='hidden' name='bindId' value='" + c.openid + "'><input type='hidden' name='bindType' value='" + c.thirdtype + "'><div class='control-group'><input type='submit' name='login' class='control-button' value='进入玩加赛事'></div></div></div><div class='rl-model-footer'></div></div>",
                $("#signin").remove(),
                $(".bind-backdrop").remove(),
                $("div").last().after(e),
                $(".bind-backdrop").show(),
                $(".rl-bind").show();
            var a = {
                type: 1,
                inputEmail: $("#third-reg-email"),
                inputMobile: $("#third-reg-mobile"),
                inputNickname: $("#third-reg-nickname"),
                inputPassword: $("#third-reg-password"),
                inputVcode: $("#third-reg-vcode"),
                msgEmail: $("#msg-third-email"),
                msgMobile: $("#msg-third-mobile"),
                msgNickname: $("#msg-third-nickname"),
                msgPassword: $("#msg-third-password"),
                msgVcode: $("#msg-third-vcode"),
                loginButton: $("input[name=login]"),
                inputBindId: $("input[name='bindId']"),
                inputBindType: $("input[name='bindType']"),
                agreeButton: $("#third-reg-agree"),
                symbolNickname: $(".nickname-third-hid"),
                symbolEmail: $(".email-third-hid"),
                symbolMobile: $(".mobile-third-hid"),
                symbolPassword: $(".password-third-hid"),
                symbolVcode: $(".vcode-third-hid"),
                seml: $("#seml")
            };
            (new LOGIN).init(),
                f(a)
        }
        , c = function (a) {
            var b = ""
                , c = a.val();
            if ("" == c || "请输入账号" == c)
                return b = "请输入账号";
            var d = /(^1[0-9]{10}$)|(^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$)/;
            return d.test(c) ? b : b = "账号格式不正确"
        }
        , d = function (a, b, c, d, e) {
            if (b.hasClass("disabled"))
                return !1;
            e = e || "",
                $.ajax({
                    url: "/sms/send",
                    type: "POST",
                    dataType: "json",
                    data: {
                        mobile: a,
                        nickname: e
                    },
                    success: function (a) {
                        0 == a.ret ? (f(b, "发送验证码", c),
                            d("")) : d(-403 == a.ret && -403 == a.code ? "请求过于频繁，请稍后再试" : a.msg)
                    }
                });
            var f = function (a, b, c) {
                0 == c ? a.removeClass("disabled").text(b) : (a.addClass("disabled").text(b + "(" + c + ")"),
                    c--,
                    setTimeout(function () {
                        f(a, b, c)
                    }, 1e3))
            }
        }
        , e = function (a) {
            var b = ""
                , c = a.val();
            return "" == c || "请输入密码" == c ? b = "请输入密码" : c.length < 6 ? b = "密码长度需大于6位" : void 0
        }
        , f = function (a) {
            var b = {
                type: 0,
                regTmp: $(".index-regist-bg"),
                bgscreenTmp: $(".fullscreen-bg-oc"),
                inputMobile: $("#reg-mobile"),
                inputEmail: $("#reg-email"),
                inputNickname: $("#reg-nickname"),
                inputPassword: $("#reg-password"),
                inputVcode: $("#reg-vcode"),
                msgNickname: $("#msg-reg-nickname"),
                msgMobile: $("#msg-reg-mobile"),
                msgEmail: $("#msg-reg-email"),
                msgPassword: $("#msg-reg-password"),
                msgVcode: $("#msg-reg-vcode"),
                symbolNickname: $(".nickname-reg-hid"),
                symbolEmail: $(".email-reg-hid"),
                symbolMobile: $(".mobile-reg-hid"),
                symbolPassword: $(".password-reg-hid"),
                symbolVcode: $(".vcode-reg-hid"),
                vcodeSendButton: $(".sms-send"),
                loginButton: $(".registBtn a"),
                agreeButton: $("#agreen"),
                agreeClass: $(".agreen"),
                msgError: $("#emsgo"),
                closeImg: $(".close-reg"),
                errorClass: "input-error",
                successClass: "input-success"
            }
                , f = $.extend(b, a)
                , g = emailChecked = passwordChecked = nicknameChecked = !1
                , h = {
                    checkName: function (a) {
                        var b = "";
                        if ("" == a || "设置昵称" == a)
                            return b = "请设置昵称";
                        var c = a.replace(/[^\x00-\xff]/g, "**").length;
                        if (4 > c || c > 16)
                            return b = "抱歉，昵称只允许4-16个字符";
                        var d = /^[\u4E00-\u9FA5\w\d.]+$/;
                        return d.test(a) ? b : b = "只允许中文、英文、数字，4-16个字符"
                    },
                    checkNickname: function () {
                        nicknameChecked = !1;
                        var a = ""
                            , b = f.inputNickname.val();
                        return (a = h.checkName(b)) ? (h.errorMessage(f.msgNickname, a, f.symbolNickname),
                            !1) : ($.ajax({
                                type: "POST",
                                url: "/check",
                                data: {
                                    name: b,
                                    type: 1
                                },
                                dataType: "json",
                                success: function (a) {
                                    0 != a.ret && (h.errorMessage(f.msgNickname, a.msg, f.symbolNickname),
                                        nicknameChecked = !1)
                                },
                                headers: {
                                    "X-Requested-With": "XMLHttpRequest"
                                }
                            }),
                                nicknameChecked = !0,
                                void f.symbolNickname.removeClass(f.errorClass).addClass(f.successClass).show())
                    },
                    checkEmail: function () {
                        emailChecked = !1;
                        var a = c(f.inputEmail);
                        if (0 != a.length)
                            return h.errorMessage(f.msgEmail, a, f.symbolEmail),
                                !1;
                        var b = f.inputEmail.val();
                        $.ajax({
                            type: "POST",
                            url: "/check",
                            data: {
                                name: b,
                                type: 2
                            },
                            dataType: "json",
                            success: function (b) {
                                0 != b.ret && (a = 1 == f.type ? '邮箱已注册，可<a class="login" href="/login">登录</a>后在个人设置绑定帐号' : b.msg,
                                    h.errorMessage(f.msgEmail, a, f.symbolEmail),
                                    emailChecked = !1)
                            },
                            headers: {
                                "X-Requested-With": "XMLHttpRequest"
                            }
                        }),
                            emailChecked = !0,
                            f.symbolEmail.removeClass(f.errorClass).addClass(f.successClass).show()
                    },
                    checkMobile: function () {
                        g = !1;
                        var a = f.inputMobile.val()
                            , b = /^\d{11}$/
                            , c = "";
                        return a ? b.test(a) ? ($.ajax({
                            type: "POST",
                            url: "/check",
                            data: {
                                name: a,
                                type: 3
                            },
                            dataType: "json",
                            success: function (a) {
                                0 != a.ret && (c = 1 == f.type ? '手机已注册，可<a class="login" href="/login">登录</a>后在个人设置绑定帐号' : a.msg,
                                    h.errorMessage(f.msgMobile, c, f.symbolMobile),
                                    g = !1)
                            },
                            headers: {
                                "X-Requested-With": "XMLHttpRequest"
                            }
                        }),
                            g = !0,
                            void f.symbolMobile.removeClass(f.errorClass).addClass(f.successClass).show()) : (c = "手机号不正确",
                                h.errorMessage(f.msgMobile, c, f.symbolMobile),
                                !1) : (c = "请输入手机号",
                                    h.errorMessage(f.msgMobile, c, f.symbolMobile),
                                    !1)
                    },
                    checkPassword: function () {
                        return passwordChecked = !1,
                            msg = e(f.inputPassword),
                            msg ? (h.errorMessage(f.msgPassword, msg, f.symbolPassword),
                                !1) : (passwordChecked = !0,
                                    void f.symbolPassword.removeClass(f.errorClass).addClass(f.successClass).show())
                    },
                    errorMessage: function (a, b, c) {
                        a.html(b).show(),
                            void 0 !== c && c.length > 0 && c.removeClass(f.successClass).addClass(f.errorClass).show()
                    }
                };
            $(".auto-i-reg").click(function () {
                $(".current-reg").toggleClass("auto-reg"),
                    $(".registBtn a").toggleClass("disagree"),
                    $(".current-reg").hasClass("auto-reg") ? $(".auto-i-reg").removeClass("auto-reg") : $(".auto-i-reg").addClass("auto-reg")
            });
            var i = 0
                , j = 0;
            void 0 !== f.inputBindId && f.inputBindId.length > 0 && (i = f.inputBindId.val(),
                j = f.inputBindType.val());
            var k = f.inputNickname
                , l = 0 == f.type ? "" : k.val();
            k.val("").focus().val(l),
                f.agreeButton.attr("checked", "checked"),
                i && j || f.closeImg.click(function () {
                    f.regTmp.hide(),
                        f.bgscreenTmp.hide()
                }),
                f.inputNickname.length > 0 ? f.inputNickname.focus(function () {
                    f.msgNickname.hide(),
                        f.symbolNickname.hide()
                }).blur(function () {
                    h.checkNickname(f.inputNickname)
                }) : nicknameChecked = !0,
                f.inputEmail.length > 0 ? f.inputEmail.focus(function () {
                    f.msgEmail.hide(),
                        f.symbolEmail.hide()
                }).blur(function () {
                    h.checkEmail(f.inputEmail)
                }) : emailChecked = !0,
                f.inputMobile.length > 0 ? f.inputMobile.focus(function () {
                    f.msgMobile.hide(),
                        f.symbolMobile.hide()
                }).blur(function () {
                    h.checkMobile(f.inputMobile)
                }) : g = !0,
                f.inputPassword.length > 0 ? f.inputPassword.focus(function () {
                    f.msgPassword.hide(),
                        f.symbolPassword.hide()
                }).blur(function () {
                    h.checkPassword()
                }) : passwordChecked = !0,
                f.inputVcode.length > 0 && f.inputVcode.focus(function () {
                    f.msgVcode.hide()
                }),
                f.vcodeSendButton.length > 0 && f.vcodeSendButton.click(function () {
                    if (!g)
                        return !1;
                    var a = $(this);
                    if ($("#captcha-div").length > 0) {
                        $("#captcha-div").show();
                        var b = ["FFFF0N00000000009BB6", (new Date).getTime(), Math.random()].join(":")
                            , c = {
                                renderTo: "nc_id",
                                appkey: "FFFF0N00000000009BB6",
                                scene: "nc_register",
                                token: b,
                                customWidth: 240,
                                trans: {
                                    key1: "code0"
                                },
                                elementID: ["usernameID"],
                                is_Opt: 0,
                                language: "cn",
                                isEnabled: !0,
                                timeout: 3e3,
                                times: 5,
                                apimap: {},
                                callback: function (c) {
                                    console.log(b),
                                        console.log(c.csessionid),
                                        console.log(c.sig),
                                        $.ajax({
                                            url: "/captcha/alicheck",
                                            type: "POST",
                                            dataType: "json",
                                            data: {
                                                nctoken: b,
                                                ncsessionid: c.csessionid,
                                                ncsig: c.sig
                                            },
                                            success: function (b) {
                                                console.log(b),
                                                    0 == b.ret ? d(f.inputMobile.val(), a, 60, function (a) {
                                                        h.errorMessage(f.msgVcode, a)
                                                    }) : alert("fasong shibai")
                                            }
                                        })
                                }
                            }
                            , e = new noCaptcha(c);
                        e.upLang("cn", {
                            _startTEXT: "请按住滑块，拖动到最右边",
                            _yesTEXT: "验证码已发送",
                            _error300: '哎呀，出错了，点击<a href="javascript:__nc.reset()">刷新</a>再来一次',
                            _errorNetwork: '网络不给力，请<a href="javascript:__nc.reset()">点击刷新</a>'
                        })
                    } else
                        d(f.inputMobile.val(), a, 60, function (a) {
                            h.errorMessage(f.msgVcode, a)
                        })
                }),
                f.loginButton.click(function () {
                    if (0 == f.type && f.loginButton.hasClass("desagree"))
                        return !1;
                    if (1 == f.type && !f.agreeButton[0].checked)
                        return !1;
                    var a = emailChecked && g && nicknameChecked && passwordChecked;
                    if (!a)
                        return $("input").blur(),
                            !1;
                    var b = f.inputEmail.val()
                        , c = f.inputMobile.val()
                        , d = f.inputNickname.val()
                        , e = f.inputPassword.val()
                        , k = f.inputVcode.val()
                        , l = window.location.href;
                    $.ajax({
                        type: "POST",
                        url: "/reg",
                        data: {
                            email: b,
                            nickname: d,
                            mobile: c,
                            vcode: k,
                            password: e,
                            agreen: f.agreeButton.val(),
                            referrer: l,
                            bindid: i,
                            bindtype: j
                        },
                        dataType: "json",
                        success: function (a) {
                            0 == a.ret ? setTimeout(window.location.href = l, 5e5) : 1 == a.code ? (1 == f.type ? msg = '邮箱已注册，可<a class="login" href="/login">登录</a>后在个人设置绑定帐号' : msg = a.msg,
                                h.errorMessage(f.msgEmail, msg, f.symbolEmail)) : 2 == a.code ? (1 == f.type ? msg = '手机号已注册，可<a class="login" href="/login">登录</a>后再个人设置绑定账号' : msg = a.msg,
                                    h.errorMessage(f.msgMobile, msg, f.symbolMobile)) : 3 == a.code ? h.errorMessage(f.msgVcode, a.msg) : 4 == a.code ? h.errorMessage(f.msgNickname, a.msg, f.symbolNickname) : 5 == a.code ? h.errorMessage(f.msgPassword, a.msg, f.symbolPassword) : 10 == a.code && (msg = "系统检测到你有灌水嫌疑，请刷新页面重试",
                                        h.errorMessage(f.msgNickname, msg))
                        },
                        headers: {
                            "X-Requested-With": "XMLHttpRequest"
                        }
                    })
                })
        }
        , g = function (a) {
            var b = {
                loginTmp: $(".index-login-bg"),
                bgscreenTmp: $(".fullscreen-bg-oc"),
                inputEmail: $("input[name='email']"),
                inputPassword: $("input[name='password']"),
                msgEmail: $("#msg-email"),
                msgPassword: $("#msg-password"),
                symbolEmail: $(".email-hid"),
                symbolPassword: $(".password-hid"),
                loginButton: $(".loginBtn a"),
                agreeButton: $("#agreen"),
                agreenClass: $(".agreen"),
                closeImg: $(".close"),
                successClass: "input-success",
                errorClass: "input-error"
            };
            settings = $.extend(b, a);
            var d = passwordChecked = !1
                , f = {
                    checkEmail: function () {
                        return d = !1,
                            msg = c(settings.inputEmail),
                            msg ? (f.errorMessage(settings.msgEmail, msg, settings.symbolEmail),
                                !1) : (d = !0,
                                    void settings.symbolEmail.removeClass(settings.errorClass).addClass(settings.successClass).show())
                    },
                    checkPassword: function () {
                        return passwordChecked = !1,
                            msg = e(settings.inputPassword),
                            msg ? (f.errorMessage(settings.msgPassword, msg, settings.symbolPassword),
                                !1) : (passwordChecked = !0,
                                    void settings.symbolPassword.removeClass(settings.errorClass).addClass(settings.successClass).show())
                    },
                    errorMessage: function (a, b, c) {
                        a.html(b).show(),
                            c.removeClass(settings.successClass).addClass(settings.errorClass).show()
                    }
                };
            $(".auto-i-log").click(function () {
                $(".current").toggleClass("auto-log"),
                    $(".current").hasClass("auto-log") ? $(".auto-i-log").removeClass("auto-log") : $(".auto-i-log").addClass("auto-log")
            }),
                settings.closeImg.click(function () {
                    settings.loginTmp.hide(),
                        settings.bgscreenTmp.hide()
                }),
                settings.inputEmail.focus(function () {
                    settings.msgEmail.hide(),
                        settings.symbolEmail.hide()
                }).blur(function () {
                    f.checkEmail()
                }),
                settings.inputPassword.focus(function () {
                    settings.msgPassword.hide(),
                        settings.symbolPassword.hide()
                }).blur(function () {
                    f.checkPassword()
                }),
                settings.loginButton.click(function () {
                    var a = d && passwordChecked;
                    if (console.log(d, passwordChecked),
                        !a)
                        return $("input").blur(),
                            !1;
                    var b = settings.inputEmail.val()
                        , c = settings.inputPassword.val();
                    $.ajax({
                        type: "POST",
                        url: "/login",
                        data: {
                            email: b,
                            password: c
                        },
                        dataType: "json",
                        success: function (a) {
                            0 == a.ret ? location.reload() : 2 == a.code ? f.errorMessage(settings.msgPassword, a.msg, settings.symbolPassword) : (3 == a.code || 1 == a.code) && f.errorMessage(settings.msgEmail, a.msg, settings.symbolEmail)
                        },
                        headers: {
                            "X-Requested-With": "XMLHttpRequest"
                        }
                    })
                }),
                document.onkeydown = function (a) {
                    var b = document.all ? window.event : a;
                    13 == b.keyCode && settings.loginButton.click()
                }
        }
        , h = function () {
            var a = '<!-- 微信登录弹窗 start--><div class="wx-login-modal" id="wx-login-modal" style="display: none"><div class="wx-login-wrapper"><div class="modal-close-btn" id="wx-modal-close-btn"><img src="/images/login/modal-close-btn.png" alt=""></div><div class="wx-login-title"><img src="/images/login/wechat-logo.png" alt=""><p>微信扫码登录/注册</p></div><div class="wx-qr-code-wrapper"><!--微信的二维码放在下面的img里--><img id="wx-qr-code-img" src="" alt=""></div><p class="wx-login-desc">扫码关注“玩加电竞”公众号，完成登录/注册</</div></div><!-- 微信登录弹窗 end-->';
            $("body").append(a)
        };
    return {
        thirdLogin: function (c) {
            defaults = {
                transit: {
                    width: 600,
                    height: 530
                },
                loginTpl: {
                    input: ["nickname", "mobile"]
                }
            },
                options = $.extend({}, defaults, c),
                "undefined" != typeof isRegister && 5 == isRegister && b(snsInfo, options.loginTpl.input),
                h();
            var d = "";
            $(".qq-login").unbind("click").click(function () {
                d = "/oauthlogin/qqconn",
                    a(d, options)
            }),
                $(".weibo-login").unbind("click").click(function () {
                    d = "/oauthlogin/weibo",
                        a(d, options)
                }),
                (new LOGIN).init()
        },
        login: function (a) {
            g(a)
        },
        register: function (a) {
            f(a)
        },
        smsSend: function (a, b, c, e, f) {
            d(a, b, c, e, f)
        }
    }
}();
Login.thirdLogin({
    loginTpl: {
        input: ["nickname", "mobile"]
    }
});
var clubTest = function () {
    layer.open({
        type: 2,
        title: !1,
        fixed: !1,
        area: ["750px", "600px"],
        skin: "ceshi-layer",
        closeBtn: 0,
        shadeClose: !0,
        content: ["/club/test", "no"]
    })
}
    , loadTimes = 1
    , redirect = function (a) {
        return a ? void window.open(a) : !1
    };
$(document).ready(function () {
    var a = function () {
        $("#loading").show(),
            ++loadTimes;
        var a, b = $(".last-list a.on").data("type");
        $.ajax({
            type: "POST",
            url: "/ajax/index/recent",
            data: {
                gametype: gameType,
                page: loadTimes,
                type: b
            },
            dataType: "json",
            success: function (c) {
                if (0 == c.ret) {
                    if ("match" == b)
                        a = template("match_list_tpl", c);
                    else {
                        a = template("recent_list_tpl", c);
                        var d = template("match_list_tpl", c.mCacheList)
                    }
                    $("#recent_list").append(a),
                        d && $("#recent_list li").first().after(d),
                        c.isEnd && $("#more").hide(),
                        $(".hot_box li em").click(function () {
                            var a = $(this).attr("class").match(/last-.+\s*/);
                            $("html,body").animate({
                                scrollTop: $(".last-list").offset().top - 50
                            }, 300),
                                $(".last-list ." + a).click()
                        })
                }
            }
        }),
            $("#loading").hide()
    };
    $("#more").unbind("click").click(function () {
        a()
    }),
        $(".last-list a").click(function () {
            return $(this).hasClass("on") ? !1 : ($(this).addClass("on").siblings().removeClass("on"),
                $("#recent_list").html(""),
                loadTimes = 0,
                void a())
        }),
        fixSideBar()
});
